A <#64#>function<#64#> is a mathematical object that takes in an argument (which could well be another function) and returns some other mathematical object. For example the function Not takes in a boolean and returns its complement. I'll write function application without brackets, so Not~b is the boolean complement of b.
Function application binds to the left, so f~a~b is (f~a)~b rather than f~(a~b). For example, Or~a~b is the boolean or of a and b, and Or~True is a perfectly good function that takes in a boolean and returns True.
The obvious equivalents of functions in TEX are macros ---
if I define a function Foo to be:
Foo~x | = | True |
So where Foo is a function that takes in one argument,verbatim67#
Baz | = | Or~True |
Onceverbatim68#
Here, I'm using = without formally defining it, which is rather
naughty. If I say x = y, this means
``given enough parameters, x and y will eventually
expand out to the same thing.'' For example Foo = Baz, because
for any x,
Foo~x;SPMnbsp;;SPMnbsp;;SPMnbsp;;SPMnbsp; | |||
= | True | ||
= | Or~True~x | ||
= | Baz~x |
All of our functions have capital letters, so that their TEX equivalents
(